/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package DAO;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Embeddable;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;


@Embeddable
public class EvenementPK implements Serializable {
    @Basic(optional = false)
    @Column(name = "ID")
    private int id;
    @Basic(optional = false)
    @Column(name = "DATEDEBUT")
    @Temporal(TemporalType.DATE)
    private Date datedebut;
    @Basic(optional = false)
    @Column(name = "DATEFIN")
    @Temporal(TemporalType.DATE)
    private Date datefin;
    @Basic(optional = false)
    @Column(name = "TITRE")
    private String titre;

    public EvenementPK() {
    }

    public EvenementPK(Date datedebut, Date datefin, String titre) {
        
        this.datedebut = datedebut;
        this.datefin = datefin;
        this.titre = titre;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public Date getDatedebut() {
        return datedebut;
    }

    public void setDatedebut(Date datedebut) {
        this.datedebut = datedebut;
    }

    public Date getDatefin() {
        return datefin;
    }

    public void setDatefin(Date datefin) {
        this.datefin = datefin;
    }

    public String getTitre() {
        return titre;
    }

    public void setTitre(String titre) {
        this.titre = titre;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (int) id;
        hash += (datedebut != null ? datedebut.hashCode() : 0);
        hash += (datefin != null ? datefin.hashCode() : 0);
        hash += (titre != null ? titre.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof EvenementPK)) {
            return false;
        }
        EvenementPK other = (EvenementPK) object;
        if (this.id != other.id) {
            return false;
        }
        if ((this.datedebut == null && other.datedebut != null) || (this.datedebut != null && !this.datedebut.equals(other.datedebut))) {
            return false;
        }
        if ((this.datefin == null && other.datefin != null) || (this.datefin != null && !this.datefin.equals(other.datefin))) {
            return false;
        }
        if ((this.titre == null && other.titre != null) || (this.titre != null && !this.titre.equals(other.titre))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "DAO.EvenementPK[ id=" + id + ", datedebut=" + datedebut + ", datefin=" + datefin + ", titre=" + titre + " ]";
    }
    
}
